import request from '@/utils/request'

// 查询笑话列表
export function listJoke(query) {
  return request({
    url: '/earn/joke/list',
    method: 'get',
    params: query
  })
}

// 查询笑话详细
export function getJoke(id) {
  return request({
    url: '/earn/joke/' + id,
    method: 'get'
  })
}

// 新增笑话
export function addJoke(data) {
  return request({
    url: '/earn/joke',
    method: 'post',
    data: data
  })
}

// 修改笑话
export function updateJoke(data) {
  return request({
    url: '/earn/joke',
    method: 'put',
    data: data
  })
}

// 删除笑话
export function delJoke(id) {
  return request({
    url: '/earn/joke/' + id,
    method: 'delete'
  })
}

export function getInfoFromJuhe() {
  return request({
    url: '/earn/joke/getInfoFromJuhe',
    method: 'get'
  })
}
